/*
 * MusicPlayer.cpp
 *
 *  Created on: 19/06/2012
 *      Author: lucho0
 */

#include "MusicPlayer.h"

#define WANT_SOUND_MUSIC true

void MusicPlayer::playPauseMusic() {
	if(!WANT_SOUND_MUSIC) return;

	Mix_Music *music = Mix_LoadMUS(MUSIC_DEFAULT_PATH);
	if (Mix_PlayingMusic() == 0) {
		Mix_PlayMusic(music, -1);
	} else {
		if (Mix_PausedMusic() == 1) {
			Mix_ResumeMusic();
		} else {
			Mix_PauseMusic();
		}
	}
}

void MusicPlayer::stopMusic(){
	if(!WANT_SOUND_MUSIC) return;

	Mix_HaltMusic();
}
